package com.wtl.controller.test;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wtl.service.entity.User;
import com.wtl.service.test.UserService;

@Controller
@RequestMapping("/User/")
public class UserController {
	 @Resource(name="userService")
	 private UserService userService;
	 @SuppressWarnings({ "unchecked", "rawtypes" })
	 @RequestMapping("/getUser")
	 @ResponseBody
     public Map getUser(){
    	   Map result=new HashMap();
    	   User u=userService.getUserBynumber("3150806001");
    	   result.put("id", u.getId());
    	   result.put("number", u.getNumber());
    	   result.put("password", u.getPassword());
    	   return result;
     }
}
